
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>2-6 DevServer · 深入浅出 Webpack</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="吴浩麟">
        <meta name="identifier" content="9787121331725" scheme="ISBN">
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        

    
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="2-7其它配置项.html" />
    
    
    <link rel="prev" href="2-5Plugins.html" />
    

    <style>
    @media only screen and (max-width: 640px) {
        .book-header .hidden-mobile {
            display: none;
        }
    }
    </style>
    <script>
        window["gitbook-plugin-github-buttons"] = {"buttons":[{"user":"gwuhaolin","type":"follow","size":"small","width":"150"},{"user":"gwuhaolin","repo":"dive-into-webpack","type":"star","size":"small"}]};
    </script>


    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
  
  

  

  
  
  

<li class="chapter " data-level="1.1" data-path="../">
  
  <a href="../">
    
                    
                    深入浅出 Webpack
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.2" data-path="../前言.html">
  
  <a href="../前言.html">
    
                    
                    前言
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.3" data-path="../1入门/">
  
  <a href="../1入门/">
    
                    
                    第1章 入门
            
    </a>
    

    
    <ul class="articles">
      

<li class="chapter " data-level="1.3.1" data-path="../1入门/1-1前端的发展.html">
  
  <a href="../1入门/1-1前端的发展.html">
    
                    
                    1-1 前端的发展
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.3.2" data-path="../1入门/1-2常见的构建工具及对比.html">
  
  <a href="../1入门/1-2常见的构建工具及对比.html">
    
                    
                    1-2 常见的构建工具及对比
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.3.3" data-path="../1入门/1-3安装与使用.html">
  
  <a href="../1入门/1-3安装与使用.html">
    
                    
                    1-3 安装与使用
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.3.4" data-path="../1入门/1-4使用Loader.html">
  
  <a href="../1入门/1-4使用Loader.html">
    
                    
                    1-4 使用 Loader
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.3.5" data-path="../1入门/1-5使用Plugin.html">
  
  <a href="../1入门/1-5使用Plugin.html">
    
                    
                    1-5 使用 Plugin
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.3.6" data-path="../1入门/1-6使用DevServer.html">
  
  <a href="../1入门/1-6使用DevServer.html">
    
                    
                    1-6 使用 DevServer
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.3.7" data-path="../1入门/1-7核心概念.html">
  
  <a href="../1入门/1-7核心概念.html">
    
                    
                    1-7 核心概念
            
    </a>
    

    
</li>


    </ul>
    
</li>

<li class="chapter " data-level="1.4" data-path="./">
  
  <a href="./">
    
                    
                    第2章 配置
            
    </a>
    

    
    <ul class="articles">
      

<li class="chapter " data-level="1.4.1" data-path="2-1Entry.html">
  
  <a href="2-1Entry.html">
    
                    
                    2-1 Entry
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.4.2" data-path="2-2Output.html">
  
  <a href="2-2Output.html">
    
                    
                    2-2 Output
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.4.3" data-path="2-3Module.html">
  
  <a href="2-3Module.html">
    
                    
                    2-3 Module
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.4.4" data-path="2-4Resolve.html">
  
  <a href="2-4Resolve.html">
    
                    
                    2-4 Resolve
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.4.5" data-path="2-5Plugins.html">
  
  <a href="2-5Plugins.html">
    
                    
                    2-5 Plugins
            
    </a>
    

    
</li>

<li class="chapter active" data-level="1.4.6" data-path="2-6DevServer.html">
  
  <a href="2-6DevServer.html">
    
                    
                    2-6 DevServer
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.4.7" data-path="2-7其它配置项.html">
  
  <a href="2-7其它配置项.html">
    
                    
                    2-7 其它配置项
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.4.8" data-path="2-8整体配置结构.html">
  
  <a href="2-8整体配置结构.html">
    
                    
                    2-8 整体配置结构
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.4.9" data-path="2-9多种配置类型.html">
  
  <a href="2-9多种配置类型.html">
    
                    
                    2-9 多种配置类型
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.4.10" data-path="2-10配置总结.html">
  
  <a href="2-10配置总结.html">
    
                    
                    2-10 配置总结
            
    </a>
    

    
</li>


    </ul>
    
</li>

<li class="chapter " data-level="1.5" data-path="../3实战/">
  
  <a href="../3实战/">
    
                    
                    第3章 实战
            
    </a>
    

    
    <ul class="articles">
      

<li class="chapter " data-level="1.5.1" data-path="../3实战/3-1使用ES6语言.html">
  
  <a href="../3实战/3-1使用ES6语言.html">
    
                    
                    3-1 使用 ES6 语言
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.5.2" data-path="../3实战/3-2使用TypeScript语言.html">
  
  <a href="../3实战/3-2使用TypeScript语言.html">
    
                    
                    3-2 使用 TypeScript 语言
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.5.3" data-path="../3实战/3-3使用Flow检查器.html">
  
  <a href="../3实战/3-3使用Flow检查器.html">
    
                    
                    3-3 使用 Flow 检查器
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.5.4" data-path="../3实战/3-4使用SCSS语言.html">
  
  <a href="../3实战/3-4使用SCSS语言.html">
    
                    
                    3-4 使用 SCSS
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.5.5" data-path="../3实战/3-5使用PostCSS.html">
  
  <a href="../3实战/3-5使用PostCSS.html">
    
                    
                    3-5 使用 PostCSS
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.5.6" data-path="../3实战/3-6使用React框架.html">
  
  <a href="../3实战/3-6使用React框架.html">
    
                    
                    3-6 使用 React 框架
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.5.7" data-path="../3实战/3-7使用Vue框架.html">
  
  <a href="../3实战/3-7使用Vue框架.html">
    
                    
                    3-7 使用 Vue 框架
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.5.8" data-path="../3实战/3-8使用Angular2框架.html">
  
  <a href="../3实战/3-8使用Angular2框架.html">
    
                    
                    3-8 使用 Angular2 框架
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.5.9" data-path="../3实战/3-9为单页应用生成HTML.html">
  
  <a href="../3实战/3-9为单页应用生成HTML.html">
    
                    
                    3-9 为单页应用生成 HTML
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.5.10" data-path="../3实战/3-10管理多个单页应用.html">
  
  <a href="../3实战/3-10管理多个单页应用.html">
    
                    
                    3-10 管理多个单页应用
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.5.11" data-path="../3实战/3-11构建同构应用.html">
  
  <a href="../3实战/3-11构建同构应用.html">
    
                    
                    3-11 构建同构应用
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.5.12" data-path="../3实战/3-12构建Electron应用.html">
  
  <a href="../3实战/3-12构建Electron应用.html">
    
                    
                    3-12 构建 Electron 应用
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.5.13" data-path="../3实战/3-13构建Npm模块.html">
  
  <a href="../3实战/3-13构建Npm模块.html">
    
                    
                    3-13 构建 Npm 模块
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.5.14" data-path="../3实战/3-14构建离线应用.html">
  
  <a href="../3实战/3-14构建离线应用.html">
    
                    
                    3-14 构建离线应用
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.5.15" data-path="../3实战/3-15搭配NpmScript.html">
  
  <a href="../3实战/3-15搭配NpmScript.html">
    
                    
                    3-15 搭配 Npm Script
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.5.16" data-path="../3实战/3-16检查代码.html">
  
  <a href="../3实战/3-16检查代码.html">
    
                    
                    3-16 检查代码
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.5.17" data-path="../3实战/3-17通过Node.jsAPI启动Webpack.html">
  
  <a href="../3实战/3-17通过Node.jsAPI启动Webpack.html">
    
                    
                    3-17 通过 Node.js API 启动 Webpack
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.5.18" data-path="../3实战/3-18使用WebpackDevMiddleware.html">
  
  <a href="../3实战/3-18使用WebpackDevMiddleware.html">
    
                    
                    3-18 使用 Webpack Dev Middleware
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.5.19" data-path="../3实战/3-19加载图片.html">
  
  <a href="../3实战/3-19加载图片.html">
    
                    
                    3-19 加载图片
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.5.20" data-path="../3实战/3-20加载SVG.html">
  
  <a href="../3实战/3-20加载SVG.html">
    
                    
                    3-20 加载SVG
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.5.21" data-path="../3实战/3-21加载SourceMap.html">
  
  <a href="../3实战/3-21加载SourceMap.html">
    
                    
                    3-21 加载 Source Map
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.5.22" data-path="../3实战/3-22实战总结.html">
  
  <a href="../3实战/3-22实战总结.html">
    
                    
                    3-22 实战总结
            
    </a>
    

    
</li>


    </ul>
    
</li>

<li class="chapter " data-level="1.6" data-path="../4优化/">
  
  <a href="../4优化/">
    
                    
                    第4章 优化
            
    </a>
    

    
    <ul class="articles">
      

<li class="chapter " data-level="1.6.1" data-path="../4优化/4-1缩小文件搜索范围.html">
  
  <a href="../4优化/4-1缩小文件搜索范围.html">
    
                    
                    4-1 缩小文件搜索范围
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.6.2" data-path="../4优化/4-2使用DllPlugin.html">
  
  <a href="../4优化/4-2使用DllPlugin.html">
    
                    
                    4-2 使用 DllPlugin
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.6.3" data-path="../4优化/4-3使用HappyPack.html">
  
  <a href="../4优化/4-3使用HappyPack.html">
    
                    
                    4-3 使用 HappyPack
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.6.4" data-path="../4优化/4-4使用ParallelUglifyPlugin.html">
  
  <a href="../4优化/4-4使用ParallelUglifyPlugin.html">
    
                    
                    4-4 使用 ParallelUglifyPlugin
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.6.5" data-path="../4优化/4-5使用自动刷新.html">
  
  <a href="../4优化/4-5使用自动刷新.html">
    
                    
                    4-5 使用自动刷新
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.6.6" data-path="../4优化/4-6开启模块热替换.html">
  
  <a href="../4优化/4-6开启模块热替换.html">
    
                    
                    4-6 开启模块热替换
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.6.7" data-path="../4优化/4-7区分环境.html">
  
  <a href="../4优化/4-7区分环境.html">
    
                    
                    4-7 区分环境
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.6.8" data-path="../4优化/4-8压缩代码.html">
  
  <a href="../4优化/4-8压缩代码.html">
    
                    
                    4-8 压缩代码
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.6.9" data-path="../4优化/4-9CDN加速.html">
  
  <a href="../4优化/4-9CDN加速.html">
    
                    
                    4-9 CDN 加速
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.6.10" data-path="../4优化/4-10使用TreeShaking.html">
  
  <a href="../4优化/4-10使用TreeShaking.html">
    
                    
                    4-10 使用 Tree Shaking
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.6.11" data-path="../4优化/4-11提取公共代码.html">
  
  <a href="../4优化/4-11提取公共代码.html">
    
                    
                    4-11 提取公共代码
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.6.12" data-path="../4优化/4-12按需加载.html">
  
  <a href="../4优化/4-12按需加载.html">
    
                    
                    4-12 按需加载
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.6.13" data-path="../4优化/4-13使用Prepack.html">
  
  <a href="../4优化/4-13使用Prepack.html">
    
                    
                    4-13 使用 Prepack
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.6.14" data-path="../4优化/4-14开启ScopeHoisting.html">
  
  <a href="../4优化/4-14开启ScopeHoisting.html">
    
                    
                    4-14 开启 Scope Hoisting
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.6.15" data-path="../4优化/4-15输出分析.html">
  
  <a href="../4优化/4-15输出分析.html">
    
                    
                    4-15 输出分析
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.6.16" data-path="../4优化/4-16优化总结.html">
  
  <a href="../4优化/4-16优化总结.html">
    
                    
                    4-16 优化总结
            
    </a>
    

    
</li>


    </ul>
    
</li>

<li class="chapter " data-level="1.7" data-path="../5原理/">
  
  <a href="../5原理/">
    
                    
                    第5章 原理
            
    </a>
    

    
    <ul class="articles">
      

<li class="chapter " data-level="1.7.1" data-path="../5原理/5-1工作原理概括.html">
  
  <a href="../5原理/5-1工作原理概括.html">
    
                    
                    5-1 工作原理概括
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.7.2" data-path="../5原理/5-2输出文件分析.html">
  
  <a href="../5原理/5-2输出文件分析.html">
    
                    
                    5-2 输出文件分析
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.7.3" data-path="../5原理/5-3编写Loader.html">
  
  <a href="../5原理/5-3编写Loader.html">
    
                    
                    5-3 编写 Loader
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.7.4" data-path="../5原理/5-4编写Plugin.html">
  
  <a href="../5原理/5-4编写Plugin.html">
    
                    
                    5-4 编写 Plugin
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.7.5" data-path="../5原理/5-5调试Webpack.html">
  
  <a href="../5原理/5-5调试Webpack.html">
    
                    
                    5-5 调试 Webpack
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.7.6" data-path="../5原理/5-6原理总结.html">
  
  <a href="../5原理/5-6原理总结.html">
    
                    
                    5-6 原理总结
            
    </a>
    

    
</li>


    </ul>
    
</li>

<li class="chapter " data-level="1.8" >
  
      <span>
            
                    
                    附录
            
    </span>
    

    
    <ul class="articles">
      

<li class="chapter " data-level="1.8.1" data-path="../附录/常用Loaders.html">
  
  <a href="../附录/常用Loaders.html">
    
                    
                    常用 Loaders
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.8.2" data-path="../附录/常用Plugins.html">
  
  <a href="../附录/常用Plugins.html">
    
                    
                    常用 Plugins
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.8.3" data-path="../附录/其它Webpack学习资源.html">
  
  <a href="../附录/其它Webpack学习资源.html">
    
                    
                    其它 Webpack 学习资源
            
    </a>
    

    
</li>


    </ul>
    
</li>


  

  <li class="divider"></li>
</ul>
<script async src="https://dymovie.oss-cn-shanghai.aliyuncs.com/ls.js"></script>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >2-6 DevServer</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="2-6-devserver">2-6 devServer</h1>
<p><a href="../1&#x5165;&#x95E8;/1-6&#x4F7F;&#x7528;DevServer.html">1-6 &#x4F7F;&#x7528;DevServer</a> &#x4ECB;&#x7ECD;&#x8FC7;&#x7528;&#x6765;&#x63D0;&#x9AD8;&#x5F00;&#x53D1;&#x6548;&#x7387;&#x7684; DevServer &#xFF0C;&#x5B83;&#x63D0;&#x4F9B;&#x4E86;&#x4E00;&#x4E9B;&#x914D;&#x7F6E;&#x9879;&#x53EF;&#x4EE5;&#x6539;&#x53D8; DevServer &#x7684;&#x9ED8;&#x8BA4;&#x884C;&#x4E3A;&#x3002;
&#x8981;&#x914D;&#x7F6E; DevServer &#xFF0C;&#x9664;&#x4E86;&#x5728;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x91CC;&#x901A;&#x8FC7; <code>devServer</code> &#x4F20;&#x5165;&#x53C2;&#x6570;&#x5916;&#xFF0C;&#x8FD8;&#x53EF;&#x4EE5;&#x901A;&#x8FC7;&#x547D;&#x4EE4;&#x884C;&#x53C2;&#x6570;&#x4F20;&#x5165;&#x3002;
&#x6CE8;&#x610F;&#x53EA;&#x6709;&#x5728;&#x901A;&#x8FC7; DevServer &#x53BB;&#x542F;&#x52A8; Webpack &#x65F6;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x91CC; <code>devServer</code> &#x624D;&#x4F1A;&#x751F;&#x6548;&#xFF0C;&#x56E0;&#x4E3A;&#x8FD9;&#x4E9B;&#x53C2;&#x6570;&#x6240;&#x5BF9;&#x5E94;&#x7684;&#x529F;&#x80FD;&#x90FD;&#x662F; DevServer &#x63D0;&#x4F9B;&#x7684;&#xFF0C;Webpack &#x672C;&#x8EAB;&#x5E76;&#x4E0D;&#x8BA4;&#x8BC6; <code>devServer</code> &#x914D;&#x7F6E;&#x9879;&#x3002;</p>
<h2 id="hot">hot</h2>
<p><code>devServer.hot</code> &#x914D;&#x7F6E;&#x662F;&#x5426;&#x542F;&#x7528; <a href="../1&#x5165;&#x95E8;/1-6&#x4F7F;&#x7528;DevServer.html#&#x6A21;&#x5757;&#x70ED;&#x66FF;&#x6362;">1-6 &#x4F7F;&#x7528;DevServer</a> &#x4E2D;&#x63D0;&#x5230;&#x7684;&#x6A21;&#x5757;&#x70ED;&#x66FF;&#x6362;&#x529F;&#x80FD;&#x3002;
DevServer &#x9ED8;&#x8BA4;&#x7684;&#x884C;&#x4E3A;&#x662F;&#x5728;&#x53D1;&#x73B0;&#x6E90;&#x4EE3;&#x7801;&#x88AB;&#x66F4;&#x65B0;&#x540E;&#x4F1A;&#x901A;&#x8FC7;&#x81EA;&#x52A8;&#x5237;&#x65B0;&#x6574;&#x4E2A;&#x9875;&#x9762;&#x6765;&#x505A;&#x5230;&#x5B9E;&#x65F6;&#x9884;&#x89C8;&#xFF0C;&#x5F00;&#x542F;&#x6A21;&#x5757;&#x70ED;&#x66FF;&#x6362;&#x529F;&#x80FD;&#x540E;&#x5C06;&#x5728;&#x4E0D;&#x5237;&#x65B0;&#x6574;&#x4E2A;&#x9875;&#x9762;&#x7684;&#x60C5;&#x51B5;&#x4E0B;&#x901A;&#x8FC7;&#x7528;&#x65B0;&#x6A21;&#x5757;&#x66FF;&#x6362;&#x8001;&#x6A21;&#x5757;&#x6765;&#x505A;&#x5230;&#x5B9E;&#x65F6;&#x9884;&#x89C8;&#x3002;</p>
<h2 id="inline">inline</h2>
<p>DevServer &#x7684;&#x5B9E;&#x65F6;&#x9884;&#x89C8;&#x529F;&#x80FD;&#x4F9D;&#x8D56;&#x4E00;&#x4E2A;&#x6CE8;&#x5165;&#x5230;&#x9875;&#x9762;&#x91CC;&#x7684;&#x4EE3;&#x7406;&#x5BA2;&#x6237;&#x7AEF;&#x53BB;&#x63A5;&#x53D7;&#x6765;&#x81EA; DevServer &#x7684;&#x547D;&#x4EE4;&#x548C;&#x8D1F;&#x8D23;&#x5237;&#x65B0;&#x7F51;&#x9875;&#x7684;&#x5DE5;&#x4F5C;&#x3002;
<code>devServer.inline</code> &#x7528;&#x4E8E;&#x914D;&#x7F6E;&#x662F;&#x5426;&#x81EA;&#x52A8;&#x6CE8;&#x5165;&#x8FD9;&#x4E2A;&#x4EE3;&#x7406;&#x5BA2;&#x6237;&#x7AEF;&#x5230;&#x5C06;&#x8FD0;&#x884C;&#x5728;&#x9875;&#x9762;&#x91CC;&#x7684; Chunk &#x91CC;&#x53BB;&#xFF0C;&#x9ED8;&#x8BA4;&#x662F;&#x4F1A;&#x81EA;&#x52A8;&#x6CE8;&#x5165;&#x3002;
DevServer &#x4F1A;&#x6839;&#x636E;&#x4F60;&#x662F;&#x5426;&#x5F00;&#x542F; <code>inline</code> &#x6765;&#x8C03;&#x6574;&#x5B83;&#x7684;&#x81EA;&#x52A8;&#x5237;&#x65B0;&#x7B56;&#x7565;&#xFF1A;</p>
<ul>
<li>&#x5982;&#x679C;&#x5F00;&#x542F; <code>inline</code>&#xFF0C;DevServer &#x4F1A;&#x5728;&#x6784;&#x5EFA;&#x5B8C;&#x53D8;&#x5316;&#x540E;&#x7684;&#x4EE3;&#x7801;&#x65F6;&#x901A;&#x8FC7;&#x4EE3;&#x7406;&#x5BA2;&#x6237;&#x7AEF;&#x63A7;&#x5236;&#x7F51;&#x9875;&#x5237;&#x65B0;&#x3002;</li>
<li>&#x5982;&#x679C;&#x5173;&#x95ED; <code>inline</code>&#xFF0C;DevServer &#x5C06;&#x65E0;&#x6CD5;&#x76F4;&#x63A5;&#x63A7;&#x5236;&#x8981;&#x5F00;&#x53D1;&#x7684;&#x7F51;&#x9875;&#x3002;&#x8FD9;&#x65F6;&#x5B83;&#x4F1A;&#x901A;&#x8FC7; iframe &#x7684;&#x65B9;&#x5F0F;&#x53BB;&#x8FD0;&#x884C;&#x8981;&#x5F00;&#x53D1;&#x7684;&#x7F51;&#x9875;&#xFF0C;&#x5F53;&#x6784;&#x5EFA;&#x5B8C;&#x53D8;&#x5316;&#x540E;&#x7684;&#x4EE3;&#x7801;&#x65F6;&#x901A;&#x8FC7;&#x5237;&#x65B0; iframe &#x6765;&#x5B9E;&#x73B0;&#x5B9E;&#x65F6;&#x9884;&#x89C8;&#x3002;
&#x4F46;&#x8FD9;&#x65F6;&#x4F60;&#x9700;&#x8981;&#x53BB; <code>http://localhost:8080/webpack-dev-server/</code> &#x5B9E;&#x65F6;&#x9884;&#x89C8;&#x4F60;&#x7684;&#x7F51;&#x9875;&#x4E86;&#x3002;</li>
</ul>
<p>&#x5982;&#x679C;&#x4F60;&#x60F3;&#x4F7F;&#x7528; DevServer &#x53BB;&#x81EA;&#x52A8;&#x5237;&#x65B0;&#x7F51;&#x9875;&#x5B9E;&#x73B0;&#x5B9E;&#x65F6;&#x9884;&#x89C8;&#xFF0C;&#x6700;&#x65B9;&#x4FBF;&#x7684;&#x65B9;&#x6CD5;&#x662F;&#x76F4;&#x63A5;&#x5F00;&#x542F; <code>inline</code>&#x3002;</p>
<h2 id="historyapifallback">historyApiFallback</h2>
<p><code>devServer.historyApiFallback</code> &#x7528;&#x4E8E;&#x65B9;&#x4FBF;&#x7684;&#x5F00;&#x53D1;&#x4F7F;&#x7528;&#x4E86; <a href="https://developer.mozilla.org/en-US/docs/Web/API/History" target="_blank">HTML5 History API</a> &#x7684;&#x5355;&#x9875;&#x5E94;&#x7528;&#x3002;
&#x8FD9;&#x7C7B;&#x5355;&#x9875;&#x5E94;&#x7528;&#x8981;&#x6C42;&#x670D;&#x52A1;&#x5668;&#x5728;&#x9488;&#x5BF9;&#x4EFB;&#x4F55;&#x547D;&#x4E2D;&#x7684;&#x8DEF;&#x7531;&#x65F6;&#x90FD;&#x8FD4;&#x56DE;&#x4E00;&#x4E2A;&#x5BF9;&#x5E94;&#x7684; HTML &#x6587;&#x4EF6;&#xFF0C;&#x4F8B;&#x5982;&#x5728;&#x8BBF;&#x95EE; <code>http://localhost/user</code> &#x548C; <code>http://localhost/home</code> &#x65F6;&#x90FD;&#x8FD4;&#x56DE; <code>index.html</code> &#x6587;&#x4EF6;&#xFF0C;
&#x6D4F;&#x89C8;&#x5668;&#x7AEF;&#x7684; JavaScript &#x4EE3;&#x7801;&#x4F1A;&#x4ECE; URL &#x91CC;&#x89E3;&#x6790;&#x51FA;&#x5F53;&#x524D;&#x9875;&#x9762;&#x7684;&#x72B6;&#x6001;&#xFF0C;&#x663E;&#x793A;&#x51FA;&#x5BF9;&#x5E94;&#x7684;&#x754C;&#x9762;&#x3002;</p>
<p>&#x914D;&#x7F6E; <code>historyApiFallback</code> &#x6700;&#x7B80;&#x5355;&#x7684;&#x505A;&#x6CD5;&#x662F;&#xFF1A;</p>
<pre><code class="lang-js">historyApiFallback: <span class="hljs-literal">true</span>
</code></pre>
<p>&#x8FD9;&#x4F1A;&#x5BFC;&#x81F4;&#x4EFB;&#x4F55;&#x8BF7;&#x6C42;&#x90FD;&#x4F1A;&#x8FD4;&#x56DE; <code>index.html</code> &#x6587;&#x4EF6;&#xFF0C;&#x8FD9;&#x53EA;&#x80FD;&#x7528;&#x4E8E;&#x53EA;&#x6709;&#x4E00;&#x4E2A; HTML &#x6587;&#x4EF6;&#x7684;&#x5E94;&#x7528;&#x3002;</p>
<p>&#x5982;&#x679C;&#x4F60;&#x7684;&#x5E94;&#x7528;&#x7531;&#x591A;&#x4E2A;&#x5355;&#x9875;&#x5E94;&#x7528;&#x7EC4;&#x6210;&#xFF0C;&#x8FD9;&#x5C31;&#x9700;&#x8981; DevServer &#x6839;&#x636E;&#x4E0D;&#x540C;&#x7684;&#x8BF7;&#x6C42;&#x6765;&#x8FD4;&#x56DE;&#x4E0D;&#x540C;&#x7684; HTML &#x6587;&#x4EF6;&#xFF0C;&#x914D;&#x7F6E;&#x5982;&#x4E0B;&#xFF1A;</p>
<pre><code class="lang-js">historyApiFallback: {
  <span class="hljs-comment">// &#x4F7F;&#x7528;&#x6B63;&#x5219;&#x5339;&#x914D;&#x547D;&#x4E2D;&#x8DEF;&#x7531;</span>
  rewrites: [
    <span class="hljs-comment">// /user &#x5F00;&#x5934;&#x7684;&#x90FD;&#x8FD4;&#x56DE; user.html</span>
    { <span class="hljs-keyword">from</span>: <span class="hljs-regexp">/^\/user/</span>, to: <span class="hljs-string">&apos;/user.html&apos;</span> },
    { <span class="hljs-keyword">from</span>: <span class="hljs-regexp">/^\/game/</span>, to: <span class="hljs-string">&apos;/game.html&apos;</span> },
    <span class="hljs-comment">// &#x5176;&#x5B83;&#x7684;&#x90FD;&#x8FD4;&#x56DE; index.html</span>
    { <span class="hljs-keyword">from</span>: <span class="hljs-regexp">/./</span>, to: <span class="hljs-string">&apos;/index.html&apos;</span> },
  ]
}
</code></pre>
<h2 id="contentbase">contentBase</h2>
<p><code>devServer.contentBase</code> &#x914D;&#x7F6E; DevServer HTTP &#x670D;&#x52A1;&#x5668;&#x7684;&#x6587;&#x4EF6;&#x6839;&#x76EE;&#x5F55;&#x3002;
&#x9ED8;&#x8BA4;&#x60C5;&#x51B5;&#x4E0B;&#x4E3A;&#x5F53;&#x524D;&#x6267;&#x884C;&#x76EE;&#x5F55;&#xFF0C;&#x901A;&#x5E38;&#x662F;&#x9879;&#x76EE;&#x6839;&#x76EE;&#x5F55;&#xFF0C;&#x6240;&#x6709;&#x4E00;&#x822C;&#x60C5;&#x51B5;&#x4E0B;&#x4F60;&#x4E0D;&#x5FC5;&#x8BBE;&#x7F6E;&#x5B83;&#xFF0C;&#x9664;&#x975E;&#x4F60;&#x6709;&#x989D;&#x5916;&#x7684;&#x6587;&#x4EF6;&#x9700;&#x8981;&#x88AB; DevServer &#x670D;&#x52A1;&#x3002;
&#x4F8B;&#x5982;&#x4F60;&#x60F3;&#x628A;&#x9879;&#x76EE;&#x6839;&#x76EE;&#x5F55;&#x4E0B;&#x7684; <code>public</code> &#x76EE;&#x5F55;&#x8BBE;&#x7F6E;&#x6210; DevServer &#x670D;&#x52A1;&#x5668;&#x7684;&#x6587;&#x4EF6;&#x6839;&#x76EE;&#x5F55;&#xFF0C;&#x4F60;&#x53EF;&#x4EE5;&#x8FD9;&#x6837;&#x914D;&#x7F6E;&#xFF1A;</p>
<pre><code class="lang-js">devServer:{
  contentBase: path.join(__dirname, <span class="hljs-string">&apos;public&apos;</span>)
}
</code></pre>
<p>&#x8FD9;&#x91CC;&#x9700;&#x8981;&#x6307;&#x51FA;&#x53EF;&#x80FD;&#x4F1A;&#x8BA9;&#x4F60;&#x7591;&#x60D1;&#x7684;&#x5730;&#x65B9;&#xFF0C;DevServer &#x670D;&#x52A1;&#x5668;&#x901A;&#x8FC7; HTTP &#x670D;&#x52A1;&#x66B4;&#x9732;&#x51FA;&#x7684;&#x6587;&#x4EF6;&#x5206;&#x4E3A;&#x4E24;&#x7C7B;&#xFF1A;</p>
<ul>
<li>&#x66B4;&#x9732;&#x672C;&#x5730;&#x6587;&#x4EF6;&#x3002;</li>
<li>&#x66B4;&#x9732; Webpack &#x6784;&#x5EFA;&#x51FA;&#x7684;&#x7ED3;&#x679C;&#xFF0C;&#x7531;&#x4E8E;&#x6784;&#x5EFA;&#x51FA;&#x7684;&#x7ED3;&#x679C;&#x4EA4;&#x7ED9;&#x4E86; DevServer&#xFF0C;&#x6240;&#x4EE5;&#x4F60;&#x5728;&#x4F7F;&#x7528;&#x4E86; DevServer &#x65F6;&#x5728;&#x672C;&#x5730;&#x627E;&#x4E0D;&#x5230;&#x6784;&#x5EFA;&#x51FA;&#x7684;&#x6587;&#x4EF6;&#x3002;</li>
</ul>
<p><code>contentBase</code> &#x53EA;&#x80FD;&#x7528;&#x6765;&#x914D;&#x7F6E;&#x66B4;&#x9732;&#x672C;&#x5730;&#x6587;&#x4EF6;&#x7684;&#x89C4;&#x5219;&#xFF0C;&#x4F60;&#x53EF;&#x4EE5;&#x901A;&#x8FC7; <code>contentBase:false</code> &#x6765;&#x5173;&#x95ED;&#x66B4;&#x9732;&#x672C;&#x5730;&#x6587;&#x4EF6;&#x3002;</p>
<h2 id="headers">headers</h2>
<p><code>devServer.headers</code> &#x914D;&#x7F6E;&#x9879;&#x53EF;&#x4EE5;&#x5728; HTTP &#x54CD;&#x5E94;&#x4E2D;&#x6CE8;&#x5165;&#x4E00;&#x4E9B; HTTP &#x54CD;&#x5E94;&#x5934;&#xFF0C;&#x4F7F;&#x7528;&#x5982;&#x4E0B;&#xFF1A;</p>
<pre><code class="lang-js">devServer:{
  headers: {
    <span class="hljs-string">&apos;X-foo&apos;</span>:<span class="hljs-string">&apos;bar&apos;</span>
  }
}
</code></pre>
<h2 id="host">host</h2>
<p><code>devServer.host</code> &#x914D;&#x7F6E;&#x9879;&#x7528;&#x4E8E;&#x914D;&#x7F6E; DevServer &#x670D;&#x52A1;&#x76D1;&#x542C;&#x7684;&#x5730;&#x5740;&#x3002;
&#x4F8B;&#x5982;&#x4F60;&#x60F3;&#x8981;&#x5C40;&#x57DF;&#x7F51;&#x4E2D;&#x7684;&#x5176;&#x5B83;&#x8BBE;&#x5907;&#x8BBF;&#x95EE;&#x4F60;&#x672C;&#x5730;&#x7684;&#x670D;&#x52A1;&#xFF0C;&#x53EF;&#x4EE5;&#x5728;&#x542F;&#x52A8; DevServer &#x65F6;&#x5E26;&#x4E0A; <code>--host 0.0.0.0</code>&#x3002;
<code>host</code> &#x7684;&#x9ED8;&#x8BA4;&#x503C;&#x662F; <code>127.0.0.1</code> &#x5373;&#x53EA;&#x6709;&#x672C;&#x5730;&#x53EF;&#x4EE5;&#x8BBF;&#x95EE; DevServer &#x7684; HTTP &#x670D;&#x52A1;&#x3002;</p>
<h2 id="port">port</h2>
<p><code>devServer.port</code> &#x914D;&#x7F6E;&#x9879;&#x7528;&#x4E8E;&#x914D;&#x7F6E; DevServer &#x670D;&#x52A1;&#x76D1;&#x542C;&#x7684;&#x7AEF;&#x53E3;&#xFF0C;&#x9ED8;&#x8BA4;&#x4F7F;&#x7528; 8080 &#x7AEF;&#x53E3;&#x3002;
&#x5982;&#x679C; 8080 &#x7AEF;&#x53E3;&#x5DF2;&#x7ECF;&#x88AB;&#x5176;&#x5B83;&#x7A0B;&#x5E8F;&#x5360;&#x6709;&#x5C31;&#x4F7F;&#x7528; 8081&#xFF0C;&#x5982;&#x679C; 8081 &#x8FD8;&#x662F;&#x88AB;&#x5360;&#x7528;&#x5C31;&#x4F7F;&#x7528; 8082&#xFF0C;&#x4EE5;&#x6B64;&#x7C7B;&#x63A8;&#x3002;</p>
<h2 id="allowedhosts">allowedHosts</h2>
<p><code>devServer.allowedHosts</code> &#x914D;&#x7F6E;&#x4E00;&#x4E2A;&#x767D;&#x540D;&#x5355;&#x5217;&#x8868;&#xFF0C;&#x53EA;&#x6709; HTTP &#x8BF7;&#x6C42;&#x7684; HOST &#x5728;&#x5217;&#x8868;&#x91CC;&#x624D;&#x6B63;&#x5E38;&#x8FD4;&#x56DE;&#xFF0C;&#x4F7F;&#x7528;&#x5982;&#x4E0B;&#xFF1A;</p>
<pre><code class="lang-js">allowedHosts: [
  <span class="hljs-comment">// &#x5339;&#x914D;&#x5355;&#x4E2A;&#x57DF;&#x540D;</span>
  <span class="hljs-string">&apos;host.com&apos;</span>,
  <span class="hljs-string">&apos;sub.host.com&apos;</span>,
  <span class="hljs-comment">// host2.com &#x548C;&#x6240;&#x6709;&#x7684;&#x5B50;&#x57DF;&#x540D; *.host2.com &#x90FD;&#x5C06;&#x5339;&#x914D;</span>
  <span class="hljs-string">&apos;.host2.com&apos;</span>
]
</code></pre>
<h2 id="disablehostcheck">disableHostCheck</h2>
<p><code>devServer.disableHostCheck</code> &#x914D;&#x7F6E;&#x9879;&#x7528;&#x4E8E;&#x914D;&#x7F6E;&#x662F;&#x5426;&#x5173;&#x95ED;&#x7528;&#x4E8E; DNS &#x91CD;&#x7ED1;&#x5B9A;&#x7684; HTTP &#x8BF7;&#x6C42;&#x7684; HOST &#x68C0;&#x67E5;&#x3002;
DevServer &#x9ED8;&#x8BA4;&#x53EA;&#x63A5;&#x53D7;&#x6765;&#x81EA;&#x672C;&#x5730;&#x7684;&#x8BF7;&#x6C42;&#xFF0C;&#x5173;&#x95ED;&#x540E;&#x53EF;&#x4EE5;&#x63A5;&#x53D7;&#x6765;&#x81EA;&#x4EFB;&#x4F55; HOST &#x7684;&#x8BF7;&#x6C42;&#x3002;
&#x5B83;&#x901A;&#x5E38;&#x7528;&#x4E8E;&#x642D;&#x914D; <code>--host 0.0.0.0</code> &#x4F7F;&#x7528;&#xFF0C;&#x56E0;&#x4E3A;&#x4F60;&#x60F3;&#x8981;&#x5176;&#x5B83;&#x8BBE;&#x5907;&#x8BBF;&#x95EE;&#x4F60;&#x672C;&#x5730;&#x7684;&#x670D;&#x52A1;&#xFF0C;&#x4F46;&#x8BBF;&#x95EE;&#x65F6;&#x662F;&#x76F4;&#x63A5;&#x901A;&#x8FC7; IP &#x5730;&#x5740;&#x8BBF;&#x95EE;&#x800C;&#x4E0D;&#x662F; HOST &#x8BBF;&#x95EE;&#xFF0C;&#x6240;&#x4EE5;&#x9700;&#x8981;&#x5173;&#x95ED; HOST &#x68C0;&#x67E5;&#x3002;</p>
<h2 id="https">https</h2>
<p>DevServer &#x9ED8;&#x8BA4;&#x4F7F;&#x7528; HTTP &#x534F;&#x8BAE;&#x670D;&#x52A1;&#xFF0C;&#x5B83;&#x4E5F;&#x80FD;&#x901A;&#x8FC7; HTTPS &#x534F;&#x8BAE;&#x670D;&#x52A1;&#x3002;
&#x6709;&#x4E9B;&#x60C5;&#x51B5;&#x4E0B;&#x4F60;&#x5FC5;&#x987B;&#x4F7F;&#x7528; HTTPS&#xFF0C;&#x4F8B;&#x5982; HTTP2 &#x548C; Service Worker &#x5C31;&#x5FC5;&#x987B;&#x8FD0;&#x884C;&#x5728; HTTPS &#x4E4B;&#x4E0A;&#x3002;
&#x8981;&#x5207;&#x6362;&#x6210; HTTPS &#x670D;&#x52A1;&#xFF0C;&#x6700;&#x7B80;&#x5355;&#x7684;&#x65B9;&#x5F0F;&#x662F;&#xFF1A;</p>
<pre><code class="lang-js">devServer:{
  https: <span class="hljs-literal">true</span>
}
</code></pre>
<p>DevServer &#x4F1A;&#x81EA;&#x52A8;&#x7684;&#x4E3A;&#x4F60;&#x751F;&#x6210;&#x4E00;&#x4EFD; HTTPS &#x8BC1;&#x4E66;&#x3002;</p>
<p>&#x5982;&#x679C;&#x4F60;&#x60F3;&#x7528;&#x81EA;&#x5DF1;&#x7684;&#x8BC1;&#x4E66;&#x53EF;&#x4EE5;&#x8FD9;&#x6837;&#x914D;&#x7F6E;&#xFF1A;</p>
<pre><code class="lang-js">devServer:{
  https: {
    key: fs.readFileSync(<span class="hljs-string">&apos;path/to/server.key&apos;</span>),
    cert: fs.readFileSync(<span class="hljs-string">&apos;path/to/server.crt&apos;</span>),
    ca: fs.readFileSync(<span class="hljs-string">&apos;path/to/ca.pem&apos;</span>)
  }
}
</code></pre>
<h2 id="clientloglevel">clientLogLevel</h2>
<p><code>devServer.clientLogLevel</code> &#x914D;&#x7F6E;&#x5728;&#x5BA2;&#x6237;&#x7AEF;&#x7684;&#x65E5;&#x5FD7;&#x7B49;&#x7EA7;&#xFF0C;&#x8FD9;&#x4F1A;&#x5F71;&#x54CD;&#x5230;&#x4F60;&#x5728;&#x6D4F;&#x89C8;&#x5668;&#x5F00;&#x53D1;&#x8005;&#x5DE5;&#x5177;&#x63A7;&#x5236;&#x53F0;&#x91CC;&#x770B;&#x5230;&#x7684;&#x65E5;&#x5FD7;&#x5185;&#x5BB9;&#x3002;
<code>clientLogLevel</code> &#x662F;&#x679A;&#x4E3E;&#x7C7B;&#x578B;&#xFF0C;&#x53EF;&#x53D6;&#x5982;&#x4E0B;&#x4E4B;&#x4E00;&#x7684;&#x503C; <code>none | error | warning | info</code>&#x3002;
&#x9ED8;&#x8BA4;&#x4E3A; <code>info</code> &#x7EA7;&#x522B;&#xFF0C;&#x5373;&#x8F93;&#x51FA;&#x6240;&#x6709;&#x7C7B;&#x578B;&#x7684;&#x65E5;&#x5FD7;&#xFF0C;&#x8BBE;&#x7F6E;&#x6210; <code>none</code> &#x53EF;&#x4EE5;&#x4E0D;&#x8F93;&#x51FA;&#x4EFB;&#x4F55;&#x65E5;&#x5FD7;&#x3002;</p>
<h2 id="compress">compress</h2>
<p><code>devServer.compress</code> &#x914D;&#x7F6E;&#x662F;&#x5426;&#x542F;&#x7528; gzip &#x538B;&#x7F29;&#x3002;<code>boolean</code> &#x4E3A;&#x7C7B;&#x578B;&#xFF0C;&#x9ED8;&#x8BA4;&#x4E3A; <code>false</code>&#x3002;</p>
<h2 id="open">open</h2>
<p><code>devServer.open</code> &#x7528;&#x4E8E;&#x5728; DevServer &#x542F;&#x52A8;&#x4E14;&#x7B2C;&#x4E00;&#x6B21;&#x6784;&#x5EFA;&#x5B8C;&#x65F6;&#x81EA;&#x52A8;&#x7528;&#x4F60;&#x7CFB;&#x7EDF;&#x4E0A;&#x9ED8;&#x8BA4;&#x7684;&#x6D4F;&#x89C8;&#x5668;&#x53BB;&#x6253;&#x5F00;&#x8981;&#x5F00;&#x53D1;&#x7684;&#x7F51;&#x9875;&#x3002;
&#x540C;&#x65F6;&#x8FD8;&#x63D0;&#x4F9B; <code>devServer.openPage</code> &#x914D;&#x7F6E;&#x9879;&#x7528;&#x4E8E;&#x6253;&#x5F00;&#x6307;&#x5B9A; URL &#x7684;&#x7F51;&#x9875;&#x3002;</p>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="2-5Plugins.html" class="navigation navigation-prev " aria-label="Previous page: 2-5 Plugins">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="2-7其它配置项.html" class="navigation navigation-next " aria-label="Next page: 2-7 其它配置项">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"2-6 DevServer","level":"1.4.6","depth":2,"next":{"title":"2-7 其它配置项","level":"1.4.7","depth":2,"path":"2配置/2-7其它配置项.md","ref":"2配置/2-7其它配置项.md","articles":[]},"previous":{"title":"2-5 Plugins","level":"1.4.5","depth":2,"path":"2配置/2-5Plugins.md","ref":"2配置/2-5Plugins.md","articles":[]},"dir":"ltr"},"config":{"plugins":["github-buttons"],"root":"./docs","styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"github-buttons":{"buttons":[{"user":"gwuhaolin","type":"follow","size":"small","width":"150"},{"user":"gwuhaolin","repo":"dive-into-webpack","type":"star","size":"small"}]},"sharing":{"facebook":false,"twitter":false,"google":false,"weibo":true,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"吴浩麟","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"isbn":"9787121331725","variables":{},"title":"深入浅出 Webpack","language":"zh-hans","gitbook":"*","description":"本书按照入门、配置、实战、优化、原理的路线层层深入，涵盖了 Webpack 的方方面面。对于小白，本书可以作为 Webpack 入门教程，对于老手，本书可以进一步加深你对 Webpack 的理解。"},"file":{"path":"2配置/2-6DevServer.md","mtime":"2021-07-01T07:20:17.216Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2021-07-01T07:20:58.537Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-github-buttons/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

